<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<base href="<%=basePath%>" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>角色管理</title>
<link rel="stylesheet" type="text/css" href="admin/css/style.css" />
<link rel="stylesheet" type="text/css" media="all" href="admin/css/niceforms-default.css" />
<script type="text/javascript" src="admin/js/jquery.min.js"></script>
<script type="text/javascript" src="admin/js/niceforms.js"></script>
<script type="text/javascript" src="admin/js/ddaccordion.js"></script>
<script type="text/javascript" src="admin/js/jconfirmaction.jquery.js"></script>
<script type="text/javascript" src="admin/js/jquery.jclock-1.2.0.js"></script>

<script type="text/javascript">
ddaccordion.init({
	headerclass: "submenuheader", //Shared CSS class name of headers group
	contentclass: "submenu", //Shared CSS class name of contents group
	revealtype: "click", //Reveal content when user clicks or onmouseover the header? Valid value: "click", "clickgo", or "mouseover"
	mouseoverdelay: 200, //if revealtype="mouseover", set delay in milliseconds before header expands onMouseover
	collapseprev: true, //Collapse previous content (so only one open at any time)? true/false 
	defaultexpanded: [1], //index of content(s) open by default [index1, index2, etc] [] denotes no content
	onemustopen: false, //Specify whether at least one header should be open always (so never all headers closed)
	animatedefault: false, //Should contents open by default be animated into view?
	persiststate: true, //persist state of opened contents within browser session?
	toggleclass: ["", ""], //Two CSS classes to be applied to the header when it's collapsed and expanded, respectively ["class1", "class2"]
	togglehtml: ["suffix", "<img src='<%=basePath%>admin/images/plus.gif' class='statusicon' />", "<img src='<%=basePath%>admin/images/minus.gif' class='statusicon' />"], //Additional HTML added to the header when it's collapsed and expanded, respectively  ["position", "html1", "html2"] (see docs)
	animatespeed: "fast", //speed of animation: integer in milliseconds (ie: 200), or keywords "fast", "normal", or "slow"
	oninit:function(headers, expandedindices){ //custom code to run when headers have initalized
		//do nothing
	},
	onopenclose:function(header, index, state, isuseractivated){ //custom code to run whenever a header is opened or closed
		//do nothing
	}
});
</script>
<script type="text/javascript">
	$(document).ready(function() {
		$('.ask').jConfirmAction();
	});
	
	$(function($) {
	    $('.jclock').jclock();
	});
	
	$(function() {
		var msg = "<s:property value='msg' />";
		if(msg != '') {
			alert(msg);
		}
	});
</script>
<script>
	function query() {
		document.queryForm.submit();
	}
</script>

</head>

<body>
<div id="main_container">
       <%@include file="../header.jsp"%>
    <div class="main_content">
         <%@include file="menu.jsp"%>
   		 <div class="center_content">  
  		  <div class="left_content">
  				   <%@include file="sidebarmenu_sys.jsp"%>
    	  </div>  
    
		    <div class="right_content">            
		        
		    	<h5>当前位置: 系统管理 &gt; 安全管理 &gt; 角色管理</h5>  
		      
		        <div>
		         	<a href="role!preAddRole" class="bt_green">
		         		<span class="bt_green_lft"></span><strong>添加角色</strong><span class="bt_green_r"></span>
		        	</a>
		        </div>       
		  
		   		<div class="sidebar_search">
                	<form name="queryForm" id="queryForm" action="role!queryRole" method="post" >
		               	<input type="text" name="roleName" id="roleName" class="search_input" value="${roleName}" title=" 输入查询角色名" />
		                <input type="image" class="search_submit" src="admin/images/search.png" onclick="query();" />
	                </form>            
		   		</div> 
		           
		        <s:if test="roles.size() != 0">   
				<table id="rounded-corner" summary="2007 Major IT Companies' Profit">
				    <thead>
				    	<tr>
				        	<th scope="col" class="rounded-company" width="1%"></th>
				            <th scope="col" class="rounded" width="8%">序号</th>
				            <th scope="col" class="rounded" width="20%">角色名</th>
				            <th scope="col" class="rounded" width="20%">角色描述</th>
				            <th scope="col" class="rounded" width="30%">操作</th>
				            <th scope="col" class="rounded-q4" width="1%"></th>
				        </tr>
				    </thead>
			        <tfoot>
			    		<tr>
				        	<td class="rounded-foot-left"></td>
				        	<td colspan="4"></td>
				        	<td class="rounded-foot-right">&nbsp;</td>
				        </tr>
				    </tfoot>
				    <tbody>
				    	<s:iterator value="roles" status="status">
				    	<tr>
				    		<td></td>
				        	<td><s:property value="#status.index+1" /></td>
				            <td>
				            	<a href="role!preEditRole?role.roleId=<s:property value='roleId' />"><s:property value="name" /></a>
				            </td>
				            <td><s:property value="roleDesc" /></td>
				            <td>
			            		<a href="role!preSetFunc?role.roleId=<s:property value='roleId' />" class="ask"><img src="admin/images/user_edit.png" title="配置权限" border="0" /></a>
				            	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				            	<a href="role!delRole?role.roleId=<s:property value='roleId' />" class="ask"><img src="admin/images/trash.png" title="删除角色" border="0" /></a>
				            </td>
				            <td></td>
				        </tr>
				        </s:iterator>
				    </tbody>
				</table>
				</s:if>
	        	<s:else>
		        	<span class="error"><s:fielderror fieldName="msg"></s:fielderror></span>
		        </s:else>
		     
			</div>  <!-- end of right content-->
                    
		</div>  <!--end of center content -->               
    
		<div class="clear"></div>
	
    </div>  <!--end of main content-->
	
	
    <%@include file="../footer.jsp" %>

</div>		
</body>
</html>